import java.util.Arrays;
import java.util.Scanner;

public class Job05 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String[] SG01 = new String[5];
        char[] SG02 = new char[SG01.length];
        for (int i = 0; i < SG01.length; i++) {
            System.out.print("请输入" +(i+1)+ "个水果名称:");
            SG01[i] = input.next();
            SG02[i] = SG01[i].charAt(0);
        }
        for (int i = 0; i < SG01.length; i++) {
            for (int j = i+1; j < SG01.length; j++) {
                if (SG02[i] > SG02[j]){
                    String tem = SG01[i];
                    SG01[i] = SG01[j];
                    SG01[j] = tem;
                }
            }
        }
        System.out.println("这些水果的英文名在字典中出现的顺序是:");
        for (String name:SG01) {
            System.out.println(name);
        }
    }
}
